﻿/*
 * Authors:    Kęstutis Džiautas
 *             Edmundas Matusevičius
 * University: VU, MIF, SE, 4 course
 * Date:       2010-12-18
 * Version:    1.0
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SemAnalyzer
{
    /// <summary>
    /// Variable Node class
    /// </summary>
    public class VariableNode
    {
        /// <summary>
        /// Constructor for simple variables
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="declared"></param>
        /// <param name="domain"></param>
        public VariableNode(string name, short type, string domain)
        {
            this.Name = name;
            this.Type = type;
            this.Classification = 0;
            this.ConstVariable = 0;
            this.Dimension = 0;
            this.Inicialized = 0;
            this.Domain = domain;
        }
        /// <summary>
        /// Constructor for array variables
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="classification"></param>
        /// <param name="constVariable"></param>
        /// <param name="dimension"></param>
        /// <param name="declared"></param>
        /// <param name="domain"></param>
        public VariableNode(string name, short type, int dimension, string domain)
        {
            this.Name = name;
            this.Type = type;
            this.Classification = 1;
            this.ConstVariable = 0;
            this.Dimension = dimension;
            this.Inicialized = 0;
            this.Domain = domain;
        }
        /// <summary>
        /// Name of the variable
        /// </summary>
        public string Name
        {
            get;
            private set;
        }
        /// <summary>
        /// Type of the variable:
        /// 0 - Char
        /// 1 - Integer
        /// 2 - Float
        /// 3 - Void
        /// 4 - Struct
        /// 5 - Enum
        /// </summary>
        public short Type
        {
            get;
            private set;
        }
        /// <summary>
        /// Clasification of the variable:
        /// 0 - simple variable
        /// 1 - array variable
        /// </summary>
        public short Classification
        {
            get;
            private set;
        }
        /// <summary>
        /// If the variable is constant
        /// </summary>
        public short ConstVariable
        {
            get;
            set;
        }
        /// <summary>
        /// Array dimension if classification is array (1)
        /// </summary>
        public int Dimension
        {
            get;
            private set;
        }
        /// <summary>
        /// Was the variable declared or not
        /// </summary>
        public short Inicialized
        {
            get;
            set;
        }
        /// <summary>
        /// Domain of the variable
        /// </summary>
        public string Domain
        {
            get;
            private set;
        }
    }
}
